/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package vista;

import Consultas.Logica;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author USUARIO WINDOWS
 */
public class vistaProducto extends javax.swing.JFrame {

    /**
     * Creates new form vistaProducto
     */
    public vistaProducto() throws SQLException {
        initComponents();
         logica = new Logica();
        proveedores = logica.obtenerProveedores();
        if (proveedores.length != 0) {
            actualizarProveedores(proveedores);
        }
        
        garantias = logica.obtenerGarantia();
        if (garantias.length != 0) {
            actualizarGarantia(garantias);
        }
          categorias = logica.obtenerCategoria();
        if (categorias.length != 0) {
            actualizarCategoria(categorias);
        }
         modelo = (DefaultTableModel) TableProducto.getModel();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel5 = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        BoxProductosE = new javax.swing.JComboBox();
        jBSeleccionarProducto = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        TableEliminarProducto = new javax.swing.JTable();
        jBEliminarProducto = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jComboBox1 = new javax.swing.JComboBox();
        jButton4 = new javax.swing.JButton();
        jTnombreProducto = new javax.swing.JTextField();
        jTPrecioProducto = new javax.swing.JTextField();
        jTCantidadProducto = new javax.swing.JTextField();
        jTColorProducto = new javax.swing.JTextField();
        jTallaProducto = new javax.swing.JTextField();
        jTDescripcionProducto = new javax.swing.JTextField();
        jComboBox2 = new javax.swing.JComboBox();
        jComboBox3 = new javax.swing.JComboBox();
        jComboBox4 = new javax.swing.JComboBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jBEditarrProducto = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLCategoria = new javax.swing.JLabel();
        jTDescripcionCategoria = new javax.swing.JTextField();
        jButton3 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jCalendar5 = new com.toedter.calendar.JCalendar();
        jCalendar6 = new com.toedter.calendar.JCalendar();
        jCProductos = new javax.swing.JComboBox();
        jBCostoHistorico = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jCalendar3 = new com.toedter.calendar.JCalendar();
        jCalendar4 = new com.toedter.calendar.JCalendar();
        jLDescrip = new javax.swing.JLabel();
        jTDescrip = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jCalendar1 = new com.toedter.calendar.JCalendar();
        jCalendar2 = new com.toedter.calendar.JCalendar();
        jLDescripcion = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jTDescuento = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLCantidad = new javax.swing.JLabel();
        jLNombre = new javax.swing.JLabel();
        jTNombre = new javax.swing.JTextField();
        jTCantidad = new javax.swing.JTextField();
        jLPrecio = new javax.swing.JLabel();
        jTPrecioEstandar = new javax.swing.JTextField();
        jDescri = new javax.swing.JLabel();
        jTDescripcion = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jTColor = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLCategori = new javax.swing.JLabel();
        jLGarantia = new javax.swing.JLabel();
        jCategoria = new javax.swing.JComboBox();
        jCGarantia = new javax.swing.JComboBox();
        jBAgregarProducto = new javax.swing.JButton();
        jLabelProveedor = new javax.swing.JLabel();
        jCProveedores = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        TableProducto = new javax.swing.JTable();

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        BoxProductosE.setModel(new javax.swing.DefaultComboBoxModel(new String[] { }));
        BoxProductosE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BoxProductosEActionPerformed(evt);
            }
        });
        jPanel2.add(BoxProductosE, new org.netbeans.lib.awtextra.AbsoluteConstraints(56, 69, 160, -1));

        jBSeleccionarProducto.setText("Seleccionar Producto");
        jBSeleccionarProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSeleccionarProductoActionPerformed(evt);
            }
        });
        jPanel2.add(jBSeleccionarProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 170, 150, -1));

        TableEliminarProducto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null}
            },
            new String [] {
                "idProducto", "Nombre", "Precio", "Cantidad", "Categoria", "Garantia", "Proveedor"
            }
        ));
        jScrollPane2.setViewportView(TableEliminarProducto);

        jPanel2.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, 790, 170));

        jBEliminarProducto.setText("Eliminar Productos");
        jBEliminarProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBEliminarProductoActionPerformed(evt);
            }
        });
        jPanel2.add(jBEliminarProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 230, -1, -1));

        jTabbedPane1.addTab("Eliminar Producto", jPanel2);

        jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(jTable1);

        jPanel3.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 390, 90));

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel3.add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 20, 180, -1));

        jButton4.setText("Producto a Editar");
        jPanel3.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 250, 180, -1));
        jPanel3.add(jTnombreProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 10, 90, -1));
        jPanel3.add(jTPrecioProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 40, 90, -1));
        jPanel3.add(jTCantidadProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 70, 90, -1));

        jTColorProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTColorProductoActionPerformed(evt);
            }
        });
        jPanel3.add(jTColorProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 100, 90, -1));
        jPanel3.add(jTallaProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 130, 90, -1));
        jPanel3.add(jTDescripcionProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 160, 90, -1));

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel3.add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 190, 90, -1));

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel3.add(jComboBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 220, 90, -1));

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jPanel3.add(jComboBox4, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 250, 90, -1));

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane4.setViewportView(jTable2);

        jPanel3.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 80, 400, 90));

        jLabel4.setText("nombre");
        jPanel3.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 10, 90, -1));

        jLabel5.setText("precio");
        jPanel3.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 40, -1, -1));

        jLabel6.setText("cantidad");
        jPanel3.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 70, -1, 20));

        jLabel7.setText("color");
        jPanel3.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 100, -1, -1));

        jLabel8.setText("talla");
        jPanel3.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 130, -1, -1));

        jLabel9.setText("Descripcion");
        jPanel3.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 160, -1, -1));

        jLabel10.setText("Categoria");
        jPanel3.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 190, -1, -1));

        jLabel11.setText("Garantia");
        jPanel3.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 220, -1, -1));

        jLabel12.setText("Proveedor");
        jPanel3.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 250, -1, -1));

        jLabel13.setText("Producto a editar:");
        jPanel3.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 20, -1, -1));

        jBEditarrProducto.setText("Editar Productos");
        jBEditarrProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBEditarrProductoActionPerformed(evt);
            }
        });
        jPanel3.add(jBEditarrProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(800, 240, 120, -1));

        jTabbedPane1.addTab("Editar Producto", jPanel3);

        jPanel4.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLCategoria.setText("Descripción de la Categoria:");
        jPanel4.add(jLCategoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 90, -1, -1));

        jTDescripcionCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTDescripcionCategoriaActionPerformed(evt);
            }
        });
        jPanel4.add(jTDescripcionCategoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 50, 250, 100));

        jButton3.setText("Agregar Categoria");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jPanel4.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 200, 170, -1));

        jTabbedPane1.addTab("Categoria producto", jPanel4);

        jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel6.add(jCalendar5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));
        jPanel6.add(jCalendar6, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 50, -1, -1));

        jCProductos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jCProductos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCProductosActionPerformed(evt);
            }
        });
        jPanel6.add(jCProductos, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 80, 110, -1));

        jBCostoHistorico.setText("Costo Historico");
        jBCostoHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBCostoHistoricoActionPerformed(evt);
            }
        });
        jPanel6.add(jBCostoHistorico, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 180, 110, -1));

        jTabbedPane1.addTab("Costo Historico", jPanel6);

        jPanel7.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel7.add(jCalendar3, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));
        jPanel7.add(jCalendar4, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 60, -1, -1));

        jLDescrip.setText("Descripción de la Garantia");
        jPanel7.add(jLDescrip, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 60, -1, -1));
        jPanel7.add(jTDescrip, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 90, 200, 80));

        jButton2.setText("Agregar Garantia");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jPanel7.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 190, -1, -1));

        jTabbedPane1.addTab("Garantia Producto", jPanel7);

        jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel8.add(jCalendar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, -1, -1));
        jPanel8.add(jCalendar2, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 60, -1, -1));

        jLDescripcion.setText("Descripción");
        jPanel8.add(jLDescripcion, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 110, -1, -1));
        jPanel8.add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 130, 180, 90));

        jLabel1.setText("Procentaje del Descuento:");
        jPanel8.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 70, -1, -1));
        jPanel8.add(jTDescuento, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 70, 50, 20));

        jButton1.setText("Agregar Promoción");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jPanel8.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 230, -1, -1));

        jTabbedPane1.addTab("Promociones", jPanel8);

        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLCantidad.setText("Cantidad:");
        jPanel1.add(jLCantidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 20, 67, 20));

        jLNombre.setText("Nombre:");
        jPanel1.add(jLNombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1));
        jPanel1.add(jTNombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 20, 100, -1));
        jPanel1.add(jTCantidad, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 20, 110, -1));

        jLPrecio.setText("Precio:");
        jPanel1.add(jLPrecio, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, -1, -1));
        jPanel1.add(jTPrecioEstandar, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 60, 100, -1));

        jDescri.setText("Descripción:");
        jPanel1.add(jDescri, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 130, -1, -1));
        jPanel1.add(jTDescripcion, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 130, 320, -1));

        jLabel2.setText("Color:");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 60, -1, -1));
        jPanel1.add(jTColor, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 60, 110, -1));

        jLabel3.setText("Tallas:");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 100, -1, -1));
        jPanel1.add(jTextField2, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 100, 100, 20));

        jLCategori.setText("Categoria");
        jPanel1.add(jLCategori, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 170, -1, 20));

        jLGarantia.setText("Garantia");
        jPanel1.add(jLGarantia, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 170, -1, -1));

        jCategoria.setModel(new javax.swing.DefaultComboBoxModel(new String[] {  }));
        jCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCategoriaActionPerformed(evt);
            }
        });
        jPanel1.add(jCategoria, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 170, 100, -1));

        jCGarantia.setModel(new javax.swing.DefaultComboBoxModel(new String[] {  }));
        jCGarantia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCGarantiaActionPerformed(evt);
            }
        });
        jPanel1.add(jCGarantia, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 170, 100, -1));

        jBAgregarProducto.setText("Agregar Producto");
        jBAgregarProducto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAgregarProductoActionPerformed(evt);
            }
        });
        jPanel1.add(jBAgregarProducto, new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 260, -1, -1));

        jLabelProveedor.setText("Proveedor :");
        jPanel1.add(jLabelProveedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 220, -1, -1));

        jCProveedores.setModel(new javax.swing.DefaultComboBoxModel(new String[] {  }));
        jCProveedores.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCProveedoresActionPerformed(evt);
            }
        });
        jPanel1.add(jCProveedores, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 220, 120, -1));

        TableProducto.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre", "Precio", "Cantidad", "Color", "Talla", "Descripcion", "Categoria", "Garantia", "Proveedor"
            }
        ));
        jScrollPane1.setViewportView(TableProducto);

        jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(460, 20, 600, 170));

        jTabbedPane1.addTab("Agregar Producto", jPanel1);

        getContentPane().add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1080, 330));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jCProductosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCProductosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCProductosActionPerformed

    private void jBCostoHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBCostoHistoricoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBCostoHistoricoActionPerformed

    private void jTDescripcionCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTDescripcionCategoriaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTDescripcionCategoriaActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCategoriaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCategoriaActionPerformed

    private void jCGarantiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCGarantiaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCGarantiaActionPerformed

    private void jBAgregarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAgregarProductoActionPerformed
        // TODO add your handling code here:
        
        modelo.addRow(new Object[]{jTNombre.getText(),jTPrecioEstandar.getText(),jTCantidad.getText(),jTColor.getText(),jTDescripcion.getText(),jCategoria.getSelectedItem(),
            jCGarantia.getSelectedItem(),jCProveedores.getSelectedItem()});
    }//GEN-LAST:event_jBAgregarProductoActionPerformed

    private void jCProveedoresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCProveedoresActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCProveedoresActionPerformed

    private void BoxProductosEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BoxProductosEActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BoxProductosEActionPerformed

    private void jBSeleccionarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSeleccionarProductoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBSeleccionarProductoActionPerformed

    private void jBEliminarProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEliminarProductoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBEliminarProductoActionPerformed

    private void jBEditarrProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBEditarrProductoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBEditarrProductoActionPerformed

    private void jTColorProductoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTColorProductoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTColorProductoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(vistaProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(vistaProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(vistaProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(vistaProducto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new vistaProducto().setVisible(true);
                } catch (SQLException ex) {
                    Logger.getLogger(vistaProducto.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox BoxProductosE;
    private javax.swing.JTable TableEliminarProducto;
    private javax.swing.JTable TableProducto;
    private javax.swing.JButton jBAgregarProducto;
    private javax.swing.JButton jBCostoHistorico;
    private javax.swing.JButton jBEditarrProducto;
    private javax.swing.JButton jBEliminarProducto;
    private javax.swing.JButton jBSeleccionarProducto;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JComboBox jCGarantia;
    private javax.swing.JComboBox jCProductos;
    private javax.swing.JComboBox jCProveedores;
    private com.toedter.calendar.JCalendar jCalendar1;
    private com.toedter.calendar.JCalendar jCalendar2;
    private com.toedter.calendar.JCalendar jCalendar3;
    private com.toedter.calendar.JCalendar jCalendar4;
    private com.toedter.calendar.JCalendar jCalendar5;
    private com.toedter.calendar.JCalendar jCalendar6;
    private javax.swing.JComboBox jCategoria;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JLabel jDescri;
    private javax.swing.JLabel jLCantidad;
    private javax.swing.JLabel jLCategori;
    private javax.swing.JLabel jLCategoria;
    private javax.swing.JLabel jLDescrip;
    private javax.swing.JLabel jLDescripcion;
    private javax.swing.JLabel jLGarantia;
    private javax.swing.JLabel jLNombre;
    private javax.swing.JLabel jLPrecio;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelProveedor;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTextField jTCantidad;
    private javax.swing.JTextField jTCantidadProducto;
    private javax.swing.JTextField jTColor;
    private javax.swing.JTextField jTColorProducto;
    private javax.swing.JTextField jTDescrip;
    private javax.swing.JTextField jTDescripcion;
    private javax.swing.JTextField jTDescripcionCategoria;
    private javax.swing.JTextField jTDescripcionProducto;
    private javax.swing.JTextField jTDescuento;
    private javax.swing.JTextField jTNombre;
    private javax.swing.JTextField jTPrecioEstandar;
    private javax.swing.JTextField jTPrecioProducto;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTextField jTallaProducto;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTnombreProducto;
    // End of variables declaration//GEN-END:variables
private Logica logica;
private String[] proveedores;
private String[] garantias;
private String[] categorias;
private DefaultTableModel modelo;

  public void actualizarProveedores(String[] vector) {
        if (vector.length != 0) {
            ComboBoxModel comb = new DefaultComboBoxModel(vector);
            jCProveedores.setModel(comb);

        }
    }



 public void actualizarBoxProveedores(String proveedor) {

        String[] listaProveedores = new String[1];
        listaProveedores[0] = proveedor;
        ComboBoxModel comb = new DefaultComboBoxModel(listaProveedores);
        jCProveedores.setModel(comb);

    }


  public void actualizarGarantia(String[] vector) {
        if (vector.length != 0) {
            ComboBoxModel comb = new DefaultComboBoxModel(vector);
            jCGarantia.setModel(comb);

        }
    }
public void actualizarBoxGarantia(String garantia) {

        String[] listaGarantia = new String[1];
        listaGarantia[0] = garantia;
        ComboBoxModel comb = new DefaultComboBoxModel(listaGarantia);
        jCGarantia.setModel(comb);

    }

  public void actualizarCategoria(String[] vector) {
        if (vector.length != 0) {
            ComboBoxModel comb = new DefaultComboBoxModel(vector);
            jCategoria.setModel(comb);

        }
    }
public void actualizarBoxCategoria(String categoria) {

        String[] listaCategoria = new String[1];
        listaCategoria[0] = categoria;
        ComboBoxModel comb = new DefaultComboBoxModel(listaCategoria);
        jCategoria.setModel(comb);

    }

}
